{include file="header.tpl.html"}


<div class="widthContent tableDiv radiusDiv shadowDiv darkBlueDiv2" style=" padding-top:4px;padding-bottom:4px;margin-bottom:20px;margin-top:10px;">	
	<div class="rowTableDiv ">
		<div class="cellTableDiv widthContent divFloat leftTopRadiusDiv rightTopRadiusDiv" style="border:none;"> 
			<table class="widthMax100 textColorWhite tableGridNew textAlignLeft fontStyleNew textColorGrey" style="margin: 2px;">
				<thead>
					<tr>
						<td >Benvenuto <b>{$usrNominativo}</b>, seleziona una campagna per iniziare.</td>
						<td class="menuText shadowTextGrey" >|</td>
						<td id="home" class="menuText shadowTextGrey" onClick="openMenu('endSession')">Logout</td>
					</tr>
					
						
				</thead>
			</table>
		</div>
	</div>
</div>


<div id="divContent" class="widthContent radiusDiv shadowDiv backWhite textAlignLeft tableDiv" style="height:auto;">
	<div class="tableDiv" >
            <div class="rowTableDiv" > 
                <div class="cellTableDiv widthContent divFloat darkBlueEffect leftTopRadiusDiv rightTopRadiusDiv"  style="height: 25px;"> 
                    <table class="widthTableHead textColorWhite tableGridNew textAlignLeft" style="">
                            <thead >
                                    <tr>
                                            <td width="20%">
                                                    Cliente
                                                    
                                            </td>

                                            <td width="20%">
                                                    Campagna
                                            </td>
                                            <td width="60%" style="cursor:default;">Note</td>
                         
                                    </tr>
                            </thead>
                    </table>
                </div>
            </div>	
	</div>
                
	<div class="rowTableDiv" >
		<div class="widthMax100 divFloat lightGreyDiv3 scrollContent"> 
			
			<table class="widthMax100 tableGridNew textAlignLeft">	
				<tbody>
					{section name=idx loop=$idCampagnaLS}
					<tr class="{cycle values='rowDispariNew,rowPariNew'}" id="tr_{$idCampagnaLS[idx]}" onClick="selectCampagna({$idCampagnaLS[idx]},'{$urlLS[idx]}')">
						<td width="20%">{$clienteLS[idx]}</td>
						<td width="20%">{$campagnaLS[idx]}</td>
						<td width="60%">{$descrizioneLS[idx]}</td>
					</tr>
					{sectionelse}
						<tr >
							<td class="rowNoElements" style="font-size:14px;height:254px;">Nessun elemento trovato</td>
						</tr>	
					{/section}
				</tbody>
			</table>
		</div>
	</div>


        <div class="tableDiv" >
		<div class="rowTableDiv" >                        
			<div class="cellTableDiv widthContent divFloat darkBlueEffect leftBottomRadiusDiv rightBottomRadiusDiv"  style="height: 0px;"> 
				&nbsp;
			</div>
		</div>			
	</div>	

</div>

<div class="widthContent textAlignRight tableDiv" style="margin-top:20px;" >
	<input type="button" id="idButtonProssimo" value="Prossimo Cliente" class="buttonNew3 effectImage radiusButton shadowButton" style="visibility:hidden;" onclick="_prossimoCliente()"/>
</div>


<input type="hidden" name="order" id="order" value="{$order}" />
<input type="hidden" name="orderType" id="orderType" value="{$orderType}" />


<input type="hidden" name="idCampagna" id="idCampagna" value="{$idCampagna}" />
<input type="hidden" name="urlCampagna" id="urlCampagna" value="{$urlCampagna}" />

</br>


{include file="funcMisc.js"}
{include file="funcSelect.js"}
{include file="funcPopup.js"}
{include file="usrObjPopupMsg.tpl.html"}

<input type="hidden" name="nextCli" id="nextCli" value="" />

<script type="text/javascript">

var loginCheck = '{$loginConsole}';
var operatore = '{$operatore}';
var alias = '{$alias}';
var password = '{$password}';

// alert ('{$idCampagna}');
checkCampagna('{$idCampagna}');
// loginConsole2(loginCheck);

{literal}

function loginConsole2(parLog)
{
// 	alert (parLog)
	if (parLog == 'N')
	{
		var thisCommand = "contaq:register?operatorid=" + alias +  "&pin=" + password + "&displayname=operatore: "+alias +"&domain=*&registrar=pbx";
		
		
// 	window.top.navigate(thisCommand);
	}
}



function checkCampagna(idCamp)
{
    if (idCamp != "")
    {
	document.getElementById("tr_" + idCamp).setAttribute('class','lightBlueDiv3');
	document.getElementById("idButtonProssimo").style.visibility = 'visible';
    }
}

function selectCampagna (idCamp,urlCamp)
{
    //alert(idCamp);

    if (idCamp != document.main.idCampagna.value) 
    {
	if (document.main.idCampagna.value != "")
	    document.getElementById("tr_" + document.main.idCampagna.value).setAttribute('class','rowPariNew');
	
	document.getElementById("tr_" + idCamp).setAttribute('class','lightBlueDiv3');
	
	document.main.idCampagna.value = idCamp;
	document.main.urlCampagna.value = urlCamp;

	document.getElementById("idButtonProssimo").style.visibility = 'visible';
    }
}

function _prossimoCliente()
{
    popMsg.resetValueObjMsg();
    
    if (document.main.idCampagna.value == '')
    {
	    usrMessageDsc = "Selezionare una campagna";
	    popMsg.warning();	
	    return;
    }

    if (document.main.urlCampagna.value ==  'REDIRECTURL')
    {
	    usrMessageDsc = "Questa campagna non ha nessuno script caricato";
	    popMsg.warning();	
	    return;
    }
// 	window.location.href ="contaq:hangup";
	
   
    document.main.nextCli.value = 'S';
    
    document.main.submit();
}

	
	
{/literal}


</script>
 

{include file="footer.tpl.html"} 
 

